#include <iostream>
#include <unordered_map>
#include <queue>
#include <vector>
using namespace std;
typedef long long LL;
priority_queue<LL, vector<LL>, greater<LL>> heap;
unordered_map<LL, LL> mp;

int main()
{
    int n; cin >> n;
    for (int i = 1; i <= n; i++)
    {
        LL x; cin >> x;
        mp[x]++;
    }
    if (mp.size() == 1)
    {
        cout << 0 << endl;
        return 0;
    }
    LL k = mp.size();
    LL ans = 0, now = 0;
    for (auto t : mp)
    {
        heap.push(t.first);
    }
    //     while(heap.size())
    //     {
    //         cout << heap.top(); heap.pop();
    //     }
    bool flag = false;
    while (heap.top() == 0)
    {
        heap.pop();
        flag = true;
    }
    while (heap.size())
    {
        while (heap.size() && now >= heap.top())
        {
            heap.pop();
            if (!flag)
            {
                flag = true;
                continue;
            }
            k--;
        }
        if (heap.size())
        {
            LL x = heap.top();
            LL t = (x - now) / k;
            if(t == 0) t++;
            now += t * k;
            ans += t;
        }
    }
    cout << ans << endl;
    return 0;
}